package mapping

import (
	"maya-service/model"
	"maya-service/model/entity"
	"maya-service/utils"
)

// GoodsCollectorsEntityToDto entity data transfer
func GoodsCollectorsEntityToDto(goodsCollectors []*entity.GoodsCollector) []*model.GoodsCollectorInfo {
	out := make([]*model.GoodsCollectorInfo, 0, len(goodsCollectors))
	for _, c := range goodsCollectors {
		out = append(out, GoodsCollectorEntityToDto(c))
	}
	return out
}

// GoodsCollectorEntityToDto entity data transfer
func GoodsCollectorEntityToDto(e *entity.GoodsCollector) *model.GoodsCollectorInfo {
	return &model.GoodsCollectorInfo{

		Id: e.Id,

		ThirdGoodsId: e.ThirdGoodsId,

		ImageURLList: utils.StrToArr(e.ImageURLList),

		GoodsDetail: e.GoodsDetail,

		GoodsPrice: e.GoodsPrice,

		GoodsStock: e.GoodsStock,

		GoodsState: e.GoodsState,

		GoodsName: e.GoodsName,

		CreatedAt: e.CreatedAt,

		UpdatedAt: e.UpdatedAt,
	}
}
